/**
 @Name：layuiAdmin 初步评审表
 @Author：star1029 
 @License：LPPL    
 */
layui.define(['table', 'form'], function(exports){
  var $ = layui.$
  ,table = layui.table
  ,form = layui.form;

  //帖子管理
  table.render({
    elem: '#LAY-app-zjprojectnofinshdetailcb-list'
    ,url: layui.setter.base + 'json/zjprojectnofinshdetailcb/list.js' //模拟接口
    ,cols: [[
      {field: 'seq', width:80,rowspan:'2',title: '序号'}      
      ,{field: 'Bidreason', rowspan:'2',title: '评审因素'}
      ,{field: 'Bidlevel', rowspan:'2',title: '评审标准'}
      ,{field:'',title:'投标人是否满足要求（符合打“√”，不符合打“×”）',align:'center',width:450,colspan:'3'}
    ],
    [
      {field:'unit1',title:'中铁城建集团有限公司',align:'center',width:150,edit: 'text'},
      {field:'unit2',title:'中铁五局集团电务工程有限责任公司',align:'center',width:150,edit: 'text'},
      {field:'unit3',title:'中铁十二局集团建筑安装工程有限公司',align:'center',width:150,edit: 'text'},
  ]
  ]
    ,page: true
    ,limit: 10
    ,limits: [10, 15, 20, 25, 30]
    ,text: '对不起，加载出现异常！'
  });
  
  //监听工具条
  table.on('tool(LAY-app-zjprojectnofinshdetailcb-list)', function(obj){
    var data = obj.data;   
     if(obj.event === 'openbid'){
      var tr = $(obj.tr);
      layer.open({
        type: 2
        ,title: data.XMMC
        ,content: '../../views/sysmang/zjprojectnofinshdetailcbbid.html'
        ,area: ['800px', '600px']
        ,btn: ['保存', '关闭']
        ,resize: false
        ,yes: function(index, layero){
          var iframeWindow = window['layui-layer-iframe'+ index]
          ,submitID = 'LAY-app-zjprojectnofinshdetailcb-submit'
          ,submit = layero.find('iframe').contents().find('#'+ submitID);
          //监听提交
          iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
            var field = data.field; //获取提交的字段
            //提交 Ajax 成功后，静态更新表格中的数据
            //$.ajax({});
            table.reload('LAY-app-zjprojectnofinshdetailcb-list'); //数据刷新
            layer.close(index); //关闭弹层
          });  
          
          submit.trigger('click');
        }
        ,success: function(layero, index){
          
        }
      }
      
      );
    }
  });
  
  exports('zjprojectnofinshdetailcb', {})
});